package com.knife.rockknife4jdemo.contorller;


import com.alibaba.fastjson.JSONObject;
import com.knife.rockknife4jdemo.dto.PrerecordLogDTO;
import com.knife.rockknife4jdemo.dto.SingleResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "预录管理", tags = "预录管理")
@Slf4j
@RestController
@SuppressWarnings("all")
@RequestMapping("/pre-recorde")
@RequiredArgsConstructor
public class DemoController {

    @GetMapping(value = "/last/prerecord/detail/{prerecordId}")
    @ApiOperation(value = "预录日志")
    public SingleResponse<PrerecordLogDTO> lastPrerecordDetail(@ApiParam(value = "预录任务ID") @PathVariable Long prerecordId) {
        PrerecordLogDTO logDTO = JSONObject.parseObject(LAST_PRERECORD, PrerecordLogDTO.class);
        return SingleResponse.of(logDTO);
    }

    public static final String LAST_PRERECORD = "{\"lastPrerecordDTO\":{\"id\":589,\"taskId\":1559,\"portCode\":\"TAICANG\",\"portDistrictCode\":\"WGQ2\",\"portDistrictName\":\"外高桥二期\",\"ctnNumber\":\"AAAA1111113\",\"sealNumber\":\"A4221082022\",\"ctnSizeType\":\"20RH\",\"vessel\":\"WWESE\",\"voyage\":\"13233\",\"vesselUncode\":null,\"ctnStatus\":\"8\",\"ctnOperatorCode\":\"WSE2SS\",\"ctnOperator\":null,\"barCode\":null,\"forwardName\":null,\"forwardCode\":null,\"loadingPort\":\"TAICANG\",\"dischargingPort\":\"SJEUSMJEWW\",\"destinationPort\":\"JSENUSJ\",\"carrierCode\":null,\"carrierName\":null,\"tareWeight\":2179,\"paymentAgent\":\"WWES2\",\"branchVessel\":\"WSES2\",\"branchVoyage\":\"F223E\",\"branchPortDistrict\":\"YS1\",\"packingTime\":null,\"packingAddress\":\"江苏省扬州市仪征市环南路与环西路交叉口南50米\",\"billInfo\":\"[{\\\"blNo\\\": \\\"TCS2022092201\\\", \\\"pkgNum\\\": 1, \\\"weight\\\": 2222, \\\"measure\\\": 12, \\\"blNoType\\\": \\\"NORMAL_BILL\\\", \\\"cargoSeqNo\\\": 1}]\",\"totalOfCargo\":2222,\"totalVolume\":12,\"totalPackageQty\":1,\"totalWeight\":4401,\"prerecordReceiptUrl\":null,\"prerecordSendTime\":null,\"prerecordReceiver\":\"OFFLINEYZS\",\"prerecordReceiptResult\":null,\"prerecordReceiptTime\":null,\"createdBy\":null,\"creationTime\":null,\"lastUpdateTime\":null,\"updatedBy\":null,\"tradeFlag\":\"W\",\"transportBusinessType\":1,\"containerId\":\"1476748\",\"gateInType\":0,\"containerBldataDTOS\":[{\"id\":null,\"prerecordId\":null,\"blNo\":\"TCS2022092201\",\"packageQty\":1,\"weight\":2222,\"volume\":12,\"blNoType\":\"NORMAL_BILL\",\"cargoSeqNo\":1,\"createdBy\":null,\"creationTime\":null,\"lastUpdateTime\":null,\"updatedBy\":null}]},\"waitPrerecordDTO\":{\"id\":90,\"status\":null,\"containerId\":1476748,\"vessel\":\"WWESE\",\"voyage\":\"13233\",\"portDistrict\":\"WGQ2\",\"portDistrictName\":\"外高桥二期\",\"dischargePortCode\":null,\"ctnOperatorCode\":\"WSE2SS\",\"placeOfDelivery\":\"JSENUSJ\",\"containerType\":null,\"gateinType\":0,\"containerNumber\":\"AAAA1111113\",\"sealNo\":null,\"tareWeight\":2179,\"preRecordStatus\":null,\"preRecordTaskType\":null,\"preRecordType\":null,\"blNo\":\"TCS2022092201\",\"packageQty\":null,\"weight\":null,\"volume\":null,\"totalPackageQty\":null,\"totalOfCargo\":null,\"totalWeight\":null,\"totalVolume\":null,\"failReasonType\":null,\"failReasonDetail\":\"图片不清楚\",\"prerecordReceiptUrl\":null,\"remark\":null,\"settlementCode\":null,\"createdBy\":null,\"creationTime\":null,\"lastUpdateTime\":null,\"updatedBy\":\"王尚兵\",\"version\":null,\"paymentAgent\":\"WWES2\",\"branchVessel\":\"WSES2\",\"branchVoyage\":\"F223E\",\"branchPortDistrict\":\"YS1\",\"branchPortDistrictName\":null,\"dischargingPort\":\"SJEUSMJEWW\",\"transportBusinessType\":1,\"tradeFlag\":\"W\",\"containerInfos\":[{\"id\":1533,\"blNoType\":\"NORMAL_BILL\",\"blNo\":\"TCS2022092201\",\"packageQty\":1,\"weight\":2222,\"volume\":12}]},\"wharfContainerDTO\":null}";
}
